/*
models.
*/

function Ctrl(name) {
	this.name = name;
	
}

Ctrl.prototype.getName = function() {
	return this.name;
}

Ctrl.prototype.run = function(app) {
	console.log('run!');
	Ctrl.prototype.g_run(app);
	Ctrl.prototype.p_run(app);
}

Ctrl.prototype.g_run = function(app) {
	var get = Ctrl.prototype.get;
	console.log('get running...');
	console.log('get object: ',get);
	for(var key in get) {
		app.get(key,function(req,res) {
			get[key](req,res);
		})

	}
}

Ctrl.prototype.p_run = function(app) {
	var post = Ctrl.prototype.post;
	console.log('post´running...');
	console.log('post object: ',post)
	for(var key in post) {
		app.post(key,function(req,res) {
			post[key](req,res);
		})

	}
}




module.exports = Ctrl;